<?php

/**
 * UsuarioFacebook filter form base class.
 *
 * @package    practil
 * @subpackage filter
 * @author     Your name here
 */
abstract class BaseUsuarioFacebookFormFilter extends BaseFormFilterPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'profile'       => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'name'          => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'first_name'    => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'last_name'     => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'link'          => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'username'      => new sfWidgetFormFilterInput(),
      'hometown_name' => new sfWidgetFormFilterInput(),
      'location_name' => new sfWidgetFormFilterInput(),
      'gender'        => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'timezone'      => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'locale'        => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'verified'      => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'usuario_id'    => new sfWidgetFormPropelChoice(array('model' => 'Usuario', 'add_empty' => true)),
    ));

    $this->setValidators(array(
      'profile'       => new sfValidatorPass(array('required' => false)),
      'name'          => new sfValidatorPass(array('required' => false)),
      'first_name'    => new sfValidatorPass(array('required' => false)),
      'last_name'     => new sfValidatorPass(array('required' => false)),
      'link'          => new sfValidatorPass(array('required' => false)),
      'username'      => new sfValidatorPass(array('required' => false)),
      'hometown_name' => new sfValidatorPass(array('required' => false)),
      'location_name' => new sfValidatorPass(array('required' => false)),
      'gender'        => new sfValidatorPass(array('required' => false)),
      'timezone'      => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'locale'        => new sfValidatorPass(array('required' => false)),
      'verified'      => new sfValidatorPass(array('required' => false)),
      'usuario_id'    => new sfValidatorPropelChoice(array('required' => false, 'model' => 'Usuario', 'column' => 'id')),
    ));

    $this->widgetSchema->setNameFormat('usuario_facebook_filters[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'UsuarioFacebook';
  }

  public function getFields()
  {
    return array(
      'id'            => 'Number',
      'profile'       => 'Text',
      'name'          => 'Text',
      'first_name'    => 'Text',
      'last_name'     => 'Text',
      'link'          => 'Text',
      'username'      => 'Text',
      'hometown_name' => 'Text',
      'location_name' => 'Text',
      'gender'        => 'Text',
      'timezone'      => 'Number',
      'locale'        => 'Text',
      'verified'      => 'Text',
      'usuario_id'    => 'ForeignKey',
    );
  }
}
